home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / game / board / Crafty-15.19.lha / crafty-15.19 / src / chess.h < prev    next >
Text File  |  1998-09-13  |  44KB  |  1,093 lines

  1. /*
  2. ********************************************************************************
  3. *                                                                              *
  4. *   configuration information:  the following variables need to be set to      *
  5. *   indicate the machine configuration/capabilities.                           *
  6. *                                                                              *
  7. *   there are pre-defined machine types for the following machines: (1) SUN    *
  8. *   (2) DOS (3) ALPHA [DEC Alpha] (4) CRAY  (5) LINUX.  defining any of these  *
  9. *   names will produce a runnable executable.  for other machines, the names   *
  10. *   explained below must be individually DEFINED or UNDEFINED as needed.       *
  11. *                                                                              *
  12. *   HAS_64BITS:  define this for a machine that has true 64-bit hardware       *
  13. *   including leading-zero hardware, population count, etc.  ie, a Cray-like   *
  14. *   machine.                                                                   *
  15. *                                                                              *
  16. *   HAS_LONGLONG:  define this for a 32-bit machine with a compiler that       *
  17. *   supports the long long (64-bit) integer data and allows bitwise operations *
  18. *   on this data type.  this provides significantly faster execution time as   *
  19. *   the bitwise operators are done by the compiler rather than by procedure    *
  20. *   calls.                                                                     *
  21. *                                                                              *
  22. *   LITTLE_ENDIAN_ARCH:  define for a 32-bit machine that mangles the way data *
  23. *   is stored within a word.  This is currently true for all PC class machines *
  24. *   and false for other processors used in current workstations (SUN, etc.)    *
  25. *                                                                              *
  26. *   UNIX:  define this if the program is being run on a unix-based system,     *
  27. *   which causes the executable to use unix-specific runtime utilities.        *
  28. *                                                                              *
  29. *   SMP:  this enables the symmetric multiprocessing code that allows Crafty   *
  30. *   to spawn threads and execute a parallel search.  Note that if this is set, *
  31. *   then the next variable must be defined as well.                            *
  32. *                                                                              *
  33. *   CPUS=N:  this sets up data structures to the appropriate size to support   *
  34. *   up to N simultaneous search engines.  note that you can set this to a      *
  35. *   value larger than the max processors you currently have, because the mt=n  *
  36. *   command (added to the command line or your crafty.rc/.craftyrc file) will  *
  37. *   control how many threads are actually spawned.                             *
  38. *                                                                              *
  39. ********************************************************************************
  40. */
  41. #if !defined(TYPES_INCLUDED)
  42.  
  43. #if !defined(CPUS)
  44. #  define CPUS 1
  45. #endif
  46.  
  47. #if defined(SMP)
  48. #  if (defined(NT_i386) || defined(NT_AXP))
  49. #    include <windows.h>
  50. #    include <process.h>
  51. #  elif defined(LINUX) || defined(ALPHA) || defined(POSIX)
  52. #    include <pthread.h>
  53. #  endif
  54. #endif
  55.  
  56. #define TYPES_INCLUDED
  57.  
  58. #if defined(AIX)
  59. #  undef  HAS_64BITS           /* machine has 64-bit integers / operators     */
  60. #  define HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  61. #  undef  LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  62. #  define UNIX                 /* system is unix-based                        */
  63. #endif
  64. #if defined(ALPHA)
  65. #  define HAS_64BITS           /* machine has 64-bit integers / operators     */
  66. #  undef  HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  67. #  define LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  68. #  define UNIX                 /* system is unix-based                        */
  69. #endif
  70. #if defined(AMIGA)
  71. #  undef  HAS_64BITS           /* machine has 64-bit integers / operators     */
  72. #  define HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  73. #  undef  LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  74. #  undef  UNIX                 /* system is unix-based                        */
  75. #endif
  76. #if defined(CRAY1)
  77. #  define HAS_64BITS           /* machine has 64-bit integers / operators     */
  78. #  undef  HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  79. #  undef  LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  80. #  define UNIX                 /* system is unix-based                        */
  81. #endif
  82. #if defined(DOS)
  83. #  undef  HAS_64BITS           /* machine has 64-bit integers / operators     */
  84. #  define HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  85. #  define LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  86. #  undef  UNIX                 /* system is unix-based                        */
  87. #endif
  88. #if defined(FreeBSD)
  89. #  undef  HAS_64BITS           /* machine has 64-bit integers / operators     */
  90. #  define HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  91. #  define LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  92. #  define UNIX                 /* system is unix-based                        */
  93. #endif
  94. #if defined(HP)
  95. #  undef  HAS_64BITS           /* machine has 64-bit integers / operators     */
  96. #  define HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  97. #  undef  LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  98. #  define UNIX                 /* system is unix-based                        */
  99. #endif
  100. #if defined(LINUX)
  101. #  undef  HAS_64BITS           /* machine has 64-bit integers / operators     */
  102. #  define HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  103. #  define LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  104. #  define UNIX                 /* system is unix-based                        */
  105. #endif
  106. #if defined(MIPS)
  107. #  undef  HAS_64BITS           /* machine has 64-bit integers / operators     */
  108. #  define HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  109. #  undef  LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  110. #  define UNIX                 /* system is unix-based                        */
  111. #endif
  112. #if defined(NEXT)
  113. #  undef  HAS_64BITS          /* machine has 64-bit integers / operators     */
  114. #  define HAS_LONGLONG        /* machine has 32-bit/64-bit integers          */
  115. #  undef  LITTLE_ENDIAN_ARCH  /* machine stores bytes in "PC" order          */
  116. #  define UNIX                /* system is unix-based                        */
  117. #endif
  118. #if defined(NT_AXP)
  119. #  undef  HAS_64BITS           /* machine has 64-bit integers / operators     */
  120. #  define HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  121. #  define LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  122. #  undef  UNIX                 /* system is unix-based                        */
  123. #endif
  124. #if defined(NT_i386)
  125. #  undef  HAS_64BITS           /* machine has 64-bit integers / operators     */
  126. #  define HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  127. #  define LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  128. #  undef  UNIX                 /* system is unix-based                        */
  129. #endif
  130. #if defined(OS2)
  131. #  undef  HAS_64BITS           /* machine has 64-bit integers / operators     */
  132. #  define HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  133. #  define LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          */
  134. #  define UNIX                 /* system is unix-based                        */
  135. #endif
  136. #if defined(SGI)
  137. #  undef  HAS_64BITS           /* machine has 64-bit integers / operators     */
  138. #  define HAS_LONGLONG         /* machine has 32-bit/64-bit integers          */
  139. #  undef  LITTLE_ENDIAN_ARCH   /* machine stores bytes in "PC" order          *